import request from '@/utils/http'

export function getClassroomById (id) {
  return request({
    url: `classroom/${id}`,
    method: 'get'
  })
}

export function listClassrooms (page, pageSize) {
  return request({
    url: 'classroom',
    method: 'get',
    params: { page, pageSize }
  })
}

export function createClassroom (data) {
  return request({
    url: 'classroom',
    method: 'post',
    data
  })
}

export function updateClassroom (data) {
  return request({
    url: 'classroom',
    method: 'put',
    data
  })
}

export function deleteClassroomById (id) {
  return request({
    url: `classroom/${id}`,
    method: 'delete',
  })
}

export function countClassroomGroupByUsageMode() {
  return request({
    url: `classroom/count/groupByUsageMode`,
    method: 'get',
  })
}
